package academic.ui.client.view;


import java.util.ArrayList;

import ui.client.GenericContainerTag;
import ui.client.widgets.InputField;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewImpl;


import academic.ui.client.config.CSSConstants;
import academic.ui.client.presenter.MyProfilePresenter;
import ecommerce.soco.shared.GWT_Customer;


public class MyProfileView extends ViewImpl implements MyProfilePresenter.MyView {

	GenericContainerTag profileDiv = new GenericContainerTag("div");
	Button personalButton = new Button("Update Personal Info");
	Button locationButton = new Button("Update Location");
	
	@Inject
	public MyProfileView(CSSConstants css) {
		
	}
	
	@Override
	public Widget asWidget() {
		return profileDiv;
	}

	@Override
	public void showProfileTab(GWT_Customer result) {
		profileDiv.clear();
		profileDiv.add(new GenericContainerTag("div","profile div content goes here"));
		
		/*
		removeErrors();
		name=new InputField("Name",customer.getFirstName()+" "+ customer.getLastName());
		email= new InputField("Email",customer.getEmailAddr());
		personalFields.add(name);
		personalFields.add(email);
		zipField=new InputField("Zip Code",customer.getDefaultAddr().getPostcode());
		cityField=new InputField("City",customer.getDefaultAddr().getCity());
		locationFields.add(zipField);
		locationFields.add(cityField);
		this.customer=customer;
		myAccountTab.clear();
		GenericContainerTag accountDiv = new GenericContainerTag("div");
		accountDiv.add(new GenericContainerTag("div","Personal Information"));
		accountDiv.add(personalErrorMsgs);
		accountDiv.add(name);
		accountDiv.add(email);
		accountDiv.add(updatePersonal);
		accountDiv.add(new GenericContainerTag("div","Where do you want to find Deals?"));
		accountDiv.add(locationErrorMsgs);
		accountDiv.add(zipField);
		accountDiv.add(cityField);
		accountDiv.add(updateLocation);	
		accountDiv.add(cardDiv);
		myAccountTab.setContent(accountDiv);
		myAccountTab.setOpen(true);
		*/
	}

	@Override
	public boolean checkLocationRules() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public GWT_Customer getCustomerUpdateAddress() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public HasClickHandlers updateLocation() {
		return locationButton;
	}

	@Override
	public boolean checkPersonalRules() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void emailAlreadyExists() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public GWT_Customer getCustomerUpdatePersonal() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public HasClickHandlers updatePersonal() {
		return personalButton;
	}
	
	
	
	
}
